package com.jt.provider.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * 创建一个服务提供方对象,通过此对象
 * 处理服务消费端请求
 */
@RestController
public class ProviderController {

    @Value("${server.port:8080}") //获取配置文件中的端口号,默认值为8080
    private String port;
    /**
     * 请求处理对象是通过方法处理客户端或消费端请求
     * @param msg
     * @return
     */
    @GetMapping("/provider/echo/{msg}")
    public String doRestEcho1(@PathVariable String msg) {

        return port + "say hello" + msg;
    }
}
